import { http } from '@/utils/http'

export interface PlagiarismResult {
  similarity: number
  matchedSubmissions: Array<{
    studentName: string
    submissionId: string
    similarity: number
    matchedContent: string
  }>
}

export const checkPlagiarism = async (submissionId: string): Promise<PlagiarismResult> => {
  const { data } = await http.post(`/api/assignments/check-plagiarism/${submissionId}`)
  return data
}